_rrrr_pppp_cccc_gggg_eeee_nnnn is a tool that generates C code to implement an RPC protocol.
_rrrr_pppp_cccc_gggg_eeee_nnnn will produce file to be used with libc [see _iiii_nnnn_tttt_rrrr_oooo_...._3333_nnnn(1)]. To
produce file to be used with libnsl see _rrrr_pppp_cccc_gggg_eeee_nnnn______tttt_llll_iiii(1). The input to
_rrrr_pppp_cccc_gggg_eeee_nnnn is a language similar to C known as RPC Language (Remote Procedure
Call Language).
_rrrr_pppp_cccc_gggg_eeee_nnnn is normally used as in the first synopsis where it takes an input
file and generates up to four output files. If the _i_n_f_i_l_e is named
_pppp_rrrr_oooo_tttt_oooo_...._xxxx, then _rrrr_pppp_cccc_gggg_eeee_nnnn will generate a header file in _pppp_rrrr_oooo_tttt_oooo_...._hhhh, XDR routines
in _pppp_rrrr_oooo_tttt_oooo______xxxx_dddd_rrrr_...._cccc, server-side stubs in _pppp_rrrr_oooo_tttt_oooo______ssss_vvvv_cccc_...._cccc, and client-side stubs
in _pppp_rrrr_oooo_tttt_oooo______cccc_llll_nnnn_tttt_...._cccc. With the _----_TTTT option, it will also generate the RPC
dispatch table in _pppp_rrrr_oooo_tttt_oooo______tttt_bbbb_llll_...._iiii.
The server created can be started both by the port monitors (for example,
_iiii_nnnn_eeee_tttt_dddd or _llll_iiii_ssss_tttt_eeee_nnnn) or by itself. When it is started by a port monitor, it
creates servers only for the transport for which the file descriptor _0000
was passed. The name of the transport must be specified by setting up
the environment variable _PPPP_MMMM______TTTT_RRRR_AAAA_NNNN_SSSS_PPPP_OOOO_RRRR_TTTT. When the server generated by
_rrrr_pppp_cccc_gggg_eeee_nnnn is executed, it creates server handles for all the transports
specified in _NNNN_EEEE_TTTT_PPPP_AAAA_TTTT_HHHH environment variable, or if it is not set, it
creates server handles for all the visible transports from _////_eeee_tttt_cccc_////_nnnn_eeee_tttt_cccc_oooo_nnnn_ffff_iiii_gggg
file. Note: the transports are chosen at run time and not at compile
time. When the server is self-started, it backgrounds itself by default.
A special symbol, _RRRR_PPPP_CCCC______SSSS_VVVV_CCCC______FFFF_GGGG, can be defined at compilation time to make
the server process run in foreground.
The second synopsis provides special features which allow for the
creation of more sophisticated RPC servers. These features include
support for user provided _####_dddd_eeee_ffff_iiii_nnnn_eeee_ssss and RPC dispatch tables. The entries
in the RPC dispatch table contain:
+o pointers to the service routine corresponding to that procedure,
+o a pointer to the input and output arguments
+o the size of these routines
A server can use the dispatch table to check authorization and then to
execute the service routine; a client library may use it to deal with the
details of storage management and XDR data conversion.
The other three synopses shown above are used when one does not want to
generate all the output files, but only a particular one. Some examples
of their usage is described in the EXAMPLE section below. When _rrrr_pppp_cccc_gggg_eeee_nnnn is
executed with the _----_ssss option, it creates servers for that particular class
Compile into server-side stubs for all the transports belonging to
the class _n_e_t_t_y_p_e. The supported classes are _nnnn_eeee_tttt_pppp_aaaa_tttt_hhhh, _vvvv_iiii_ssss_iiii_bbbb_llll_eeee,
_cccc_iiii_rrrr_cccc_uuuu_iiii_tttt______nnnn, _cccc_iiii_rrrr_cccc_uuuu_iiii_tttt______vvvv, _dddd_aaaa_tttt_aaaa_gggg_rrrr_aaaa_mmmm______nnnn, _dddd_aaaa_tttt_aaaa_gggg_rrrr_aaaa_mmmm______vvvv, _tttt_cccc_pppp, and _uuuu_dddd_pppp [see
_rrrr_pppp_cccc(3N) for the meanings associated with these classes]. This
option may be specified more than once. Note: the transports are
chosen at run time and not at compile time.
_----_tttt Compile into RPC dispatch table.
_----_TTTT Generate the code to support RPC dispatch tables.
The options _----_cccc, _----_hhhh, _----_llll, _----_mmmm, _----_ssss and _----_tttt are used exclusively to generate a
particular type of file, while the options _----_DDDD, _----_PPPP, and _----_TTTT are global and
can be used with the other options.
NNNNOOOOTTTTEEEESSSS
The RPC Language does not support nesting of structures. As a work-
around, structures can be declared at the top-level, and their name used
inside other structures in order to achieve the same effect.
Name clashes can occur when using program definitions, since the apparent
scoping does not really apply. Most of these can be avoided by giving
unique names for programs, versions, procedures and types.
The server code generated with _----_nnnn option refers to the transport
indicated by _n_e_t_i_d and hence is very site specific.
EEEEXXXXAAAAMMMMPPPPLLLLEEEE
The following example:
rpcgen -T prot.x
generates all the five files: _pppp_rrrr_oooo_tttt_...._hhhh, _pppp_rrrr_oooo_tttt______cccc_llll_nnnn_tttt_...._cccc, _pppp_rrrr_oooo_tttt______ssss_vvvv_cccc_...._cccc,
_pppp_rrrr_oooo_tttt______xxxx_dddd_rrrr_...._cccc and _pppp_rrrr_oooo_tttt______tttt_bbbb_llll_...._iiii.
The following example sends the C data-definitions (header file) to the
standard output.
rpcgen -h prot.x
To send the test version of the _----_DDDD_TTTT_EEEE_SSSS_TTTT, server side stubs for all the
transport belonging to the class _dddd_aaaa_tttt_aaaa_gggg_rrrr_aaaa_mmmm______nnnn to standard output, use:
rpcgen -s datagram_n -DTEST prot.x
To create the server side stubs for the transport indicated by _n_e_t_i_d _tttt_cccc_pppp,